package ModelLayer;
import java.util.Date;

public class DiscountProduct
{
    private double discount;
    private Date startDate, endDate;
    
    public DiscountProduct()
    {
        this(0,new Date());
    }
    
    public DiscountProduct(double discount,Date endDate)
    {
        this.discount = discount;
        this.endDate = endDate;
        this.startDate = new Date();
    }
    
    public double getDiscount()
    {
        if(startDate.getTime() > endDate.getTime()) this.setDiscount(0.00);
        return this.discount;
    }
    
    public void setDiscount(double discount) {
        this.discount = discount;
    }
    
    public void setEndDate(Date newDate) {
        this.endDate = newDate;
    }
    
    public Date getEndDate() {
        return endDate;
    }
}
